/*  1:   */ package com.rinsi.core.contoller;
/*  2:   */ 
/*  3:   */ import com.rinsi.core.CoreCache;
/*  4:   */ import com.rinsi.core.service.CoreService;
/*  5:   */ import com.rinsi.util.AssertUtil;
/*  6:   */ import com.rinsi.util.ListUtil;
/*  7:   */ import com.rinsi.util.MapUtil;
/*  8:   */ import java.util.List;
/*  9:   */ import java.util.Map;
/* 10:   */ import javax.servlet.http.HttpServletRequest;
/* 11:   */ import org.apache.log4j.Logger;
/* 12:   */ import org.springframework.ui.ModelMap;
/* 13:   */ import org.springframework.web.bind.annotation.ModelAttribute;
/* 14:   */ import org.springframework.web.bind.annotation.RequestMapping;
/* 15:   */ 
/* 16:   */ public abstract class CoreController
/* 17:   */ {
/* 18:27 */   private static Logger logger = Logger.getLogger(CoreSimpleController.class);
/* 19:   */   
/* 20:   */   @ModelAttribute
/* 21:   */   public void model(ModelMap model, HttpServletRequest request)
/* 22:   */   {
/* 23:38 */     Map<String, Object> params = MapUtil.createParamsMap(request);
/* 24:   */     
/* 25:40 */     Map<String, Object> config = MapUtil.createConfigMap(getClass());
/* 26:45 */     if (AssertUtil.isStringNotEmpty(MapUtil.getString(params, "UID")))
/* 27:   */     {
/* 28:47 */       String uid = MapUtil.getString(params, "UID");
/* 29:   */       
/* 30:49 */       List<Map<String, Object>> modules = CoreCache.getCacheList(uid, "modules");
/* 31:   */       
/* 32:51 */       Map<String, Object> module = CoreCache.getCacheMap(uid, "module");
/* 33:   */       
/* 34:53 */       List<Map<String, Object>> rights = ListUtil.subList(modules, "MODULE_NO_PRE='" + MapUtil.getString(module, "MODULE_NO") + "'");
/* 35:   */       
/* 36:55 */       model.put("module", module);
/* 37:   */       
/* 38:57 */       model.put("module_sub", rights);
/* 39:   */       
/* 40:59 */       model.put("module_rights", ListUtil.listToMap(rights, "MODULE_TYPE"));
/* 41:   */     }
/* 42:62 */     model.put("params", params);
/* 43:   */     
/* 44:64 */     model.put("config", config);
/* 45:   */   }
/* 46:   */   
/* 47:   */   @RequestMapping({"/index"})
/* 48:   */   public Map<String, Object> index(ModelMap model, HttpServletRequest request)
/* 49:   */   {
/* 50:81 */     model.putAll(servce().index(model));
/* 51:83 */     if (logger.isDebugEnabled()) {
/* 52:85 */       logger.debug("index信息：" + MapUtil.json(model));
/* 53:   */     }
/* 54:89 */     return model;
/* 55:   */   }
/* 56:   */   
/* 57:   */   public abstract CoreService servce();
/* 58:   */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.core.contoller.CoreController
 * JD-Core Version:    0.7.0.1
 */